import MySQLdb

conn = MySQLdb.connect(host='127.0.0.1',port=3306,user='ccd',passwd='123456',db='computer_status', charset="utf8")
cur = conn.cursor()
sql = "select o_number,o_name,o_category,'未知',o_asset_users,f6,'1','2021-5-7' from sheet1"
cur.execute(sql)
ccd = cur.fetchall()
ccd = str(ccd)[1:-1]
sql = "insert into `computerstatus_oassets`(o_number,o_name,o_category,o_seat_number,o_asset_users,o_remarks,o_num,o_time) values {}".format(ccd)
print(sql)
cur.execute(sql)
conn.commit()
"""'PHY-IT-005', 'IT笔记本', 'DELL Inspiron14-3467', '未知',      '黄梓峰',     '2N83QJ2',    '',         '1',  '2021-5-7'
    'ip_number' , 'ip_name', 'ip_category', 'ip_seat_number','ip_asset_users','ip_mac','ip_remarks', 'ip_num','ip_time'
"""



"""ip_number,ip_name,ip_category,ip_num,ip_seat_number,ip_asset_users,ip_time,ip_mac,ip_remarks"""
